import "pkl:test"

res1 =
  let (x: Int = 42)
    x + 1

res2 =
  let (str: String(endsWith("P")) = "Pigeon".reverse())
    str.reverse()

res3 =
  let (x: Duration(unit == "min") = 3.min + 2.min)
    let (y: Float(isPositive) = 1.2 + 1.3)
      x * y

res4 =
  let (xs: List<Null|Boolean|"Pigeon"> = List("Pigeon", true, null))
    xs

res5 = test.catch(() ->
  let (x: String = 42)
    x + 1)

res6 = test.catch(() ->
  let (str: String(endsWith("A")) = "Pigeon".reverse())
    str.reverse())

res7 = test.catch(() ->
  let (x: Duration(unit == "min") = 3.min + 2.min)
    let (y: Float(!isPositive) = 1.2 + 1.3)
      x * y)

res8 = test.catch(() ->
  let (xs: List<Null|Boolean|"Pigeon"> = List("Barn Owl", true, null))
    xs)
